{extend name="layout/layout" /}

{block name="pagecss"}
<link href="__STATIC__/plugins/bootstrap-timepicker/css/bootstrap-timepicker.min.css" rel="stylesheet" type="text/css" />
{/block}

{block name="content"}
<div class="row">
    <div class="col-md-12">
        <div class="portlet light">
            <div class="portlet-title">
                <div class="caption">
                    <i class="icon-share font-dark"></i>
                    <span class="caption-subject font-dark bold uppercase"> 添加测评</span>
                </div>
                <div class="actions">
                    <a class="btn btn-circle btn-icon-only btn-default fullscreen" href="javascript:;" data-original-title="" title=""> </a>
                </div>
            </div>
            <div class="portlet-body">
                <form id="ajax-form" class="form-horizontal" enctype="multipart/form-data">
                    {:token()}
                    <div class="form-body">
                        <div class="row" style="margin-bottom: 10px;">
                            <div class="col-md-9">
                                <div class="form-inline">
                                    <label class="control-label col-md-3">
                                        测评范围
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        {include file="common:selectarea" /}
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        测评主题
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <input type="text" class="form-control" id="name" maxlength="40" placeholder="最多输入40字" name="name" data-name="" value="" >
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        测评开始时间
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-4">
                                        <input type="text" class="form-control" id="date" name="date" value="" placeholder="选择日期" >
                                    </div>
                                    <div class="col-md-4">
                                        <input type="text" class="form-control" id="startTime" name="startTime" value="" autocomplete="off">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        测评时长
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-4">
                                        <input type="number" class="form-control" maxlength="10" placeholder="" name="time" value="" >
                                    </div>
                                    <span class="help-inline">小时</span>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        测评题目
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <input type="hidden" class="examquestionsIds" name="examquestionsIds" value="" >
                                        <div class="exam-div">
                                            <button type="button" class="btn btn-success addExam-btn" style="margin-top: 10px;">
                                                <i class="fa fa-plus"></i> 添加题目
                                            </button>
                                            <div class="portlet light" style="padding: 0">
                                                <div class="portlet-body">
                                                    <form action="" class="form-horizontal" name="ajaxForm">
                                                        <div class="">
                                                            <table id="exam-datatable" class="table table-bordered table-hover dataTable">
                                                                <thead>
                                                                <th>题号</th>
                                                                <th>题目</th>
                                                                <th>类型</th>
                                                                <th>分数</th>
                                                                <th>操作</th>
                                                                </thead>
                                                            </table>
                                                        </div>
                                                    </form>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        及格分
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-4">
                                        <input type="number" class="form-control" id="passingGrade" name="passingGrade" value="1" >
                                    </div>
                                    <span class="help-inline"><!--当前总分--></span>
                                </div>
                            </div>
                        </div>

                        <input type="hidden" class="id" name="id" value="">
                        <input type="hidden" class="examId" name="examId" value="{$examId}">
                        <hr />

                        <div class="row">
                            <div class="form-actions">
                                <div class="col-md-offset-2 col-md-10">
                                    <button type="button" class="btn blue save-btn">
                                        保存 <i class="fa fa-floppy-o"></i>
                                    </button>
                                    <button type="button" class="btn default" onclick="history.go(-1);">
                                        返回 <i class="fa fa-mail-forward"></i>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<!-- 详情 模态框 -->
<div class="modal fade" id="view-modal" data-backdrop="static" data-keyboard="false" >
    <div class="modal-dialog" style="width:800px; height: 520px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">x</button>
                <h4 class="modal-title">考题</h4>
            </div>
            <div class="modal-body">

            </div>
            <div class="modal-footer">
                <button type="button" class="btn blue saveExam-btn"> 确定 </button>
                <button type="button" class="btn default" data-dismiss="modal"> 关闭 </button>
            </div>
        </div>
    </div>
</div>

<input type="hidden" class="token_url" value="{:url('admin/Image/token')}">
<input type="hidden" class="record_url" value="{:url('admin/Image/record')}">
<input type="hidden" class="delimage_url" value="{:url('admin/Image/delete')}">

<input type="hidden" class="redirect_url" value="{:url('admin/'.strtolower($model).'/index')}">
<input type="hidden" class="save_url" value="{:url('admin/'.strtolower($model).'/savepost')}">
<input type="hidden" class="checkName_url" value="{:url('admin/'.strtolower($model).'/checkName')}">

<input type="hidden" class="examDatalist_url" value="{:url('admin/'.strtolower($model).'/examquestions')}">
<input type="hidden" class="examDelete_url" value="{:url('admin/'.strtolower($model).'/delexam')}">
<input type="hidden" class="viewExam_url" value="{:url('admin/'.strtolower($model).'/viewexam')}">
<input type="hidden" class="saveExam_url" value="{:url('admin/'.strtolower($model).'/saveexam')}">
<input type="hidden" class="checkExamNumber_url" value="{:url('admin/'.strtolower($model).'/checkexamnumber')}">
{/block}

{block name="pagescript"}
<script src="__STATIC__/plugins/bootstrap-timepicker/js/bootstrap-timepicker.js"></script>

<script src="__STATIC__/admin/pages/js/onlineexam.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/examquestions.js" type="text/javascript"></script>
{/block}